/******************************************************************************
 *                                                                            *
 *                            Volatile Programming                            *
 *                              Menu_Example.cpp                              *
 *                                                                            *
 ******************************************************************************
 *                                                                            *
 * By: Volatile Pulse                                                         *
 * What: An example to demonstrate the different features of the Menu class   *
 * Date: 06.15.2012                                                           *
 *                                                                            *
 ******************************************************************************/

#include "lib\menu.h"
#include "lib\header.h"

using namespace std;

int main() {
    // Disable Console Cursor
    VP_SetConsoleCursor(false);

    // Declare MenuExample
    Menu MenuExample;
    MenuExample.SetSelectors(">");
    MenuExample.AddOption("Exit");
    MenuExample.AddOption("Give Me a Title");

    // Handle Menu
    do {
        switch(MenuExample.Play(MenuExample.Size())) {
            // Exit
            case 1:
                break;
            // Give Me a Title
            case 2:
                if(MenuExample.Size() == 2) {
                    MenuExample.SetTitle("Here Is My Title");
                    MenuExample.AddOption("Change My Selectors");
                }
                break;
            // Change My Selectors
            case 3:
                if(MenuExample.Size() == 3) {
                    MenuExample.SetSelectors("-> ", " <-");
                    MenuExample.AddOption("Move Me To Yhe Bottom Right");
                }
                break;
            // Move Me To The Bottom Right
            // Cemterize Me!
            case 4:
                if(MenuExample.Size() == 5) {
                    MenuExample.SetLocation(CENTER, CENTER);
                    MenuExample.AddOption("_Volatile Pulse Productions_");
                }
                if(MenuExample.Size() == 4) {
                    MenuExample.SetLocation(BOTTOM, RIGHT);
                    MenuExample.AddOption("Change My Previous Option");
                }
                break;
            // Change My Previous Option
            case 5:
                if(MenuExample.Size() == 5)
                    MenuExample.SetOption(4, "Centerize Me!");
                break;
        }
    } while (MenuExample.LastSelection() != 1);

    return 0;
}